home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 2.7 KB | 101 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: LineShp.h
- // Release Version: $ ODF 1 $
- //
- // Author: Henri Lamiraux
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef LINESHP_H
- #define LINESHP_H
-
- #ifndef CONSTANT_H
- #include "Constant.h"
- #endif
-
- #ifndef BASESHP_H
- #include "BaseShp.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWPOINT_H
- #include "FWPoint.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- //========================================================================================
- // class CLineShape
- //========================================================================================
-
- class CLineShape : public CBaseShape
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(CLineShape)
-
- public:
- CLineShape(CDrawPart* drawPart);
- CLineShape(CDrawPart* drawPart, FW_CReadableStream& archive);
- virtual ~CLineShape();
-
- // ----- Geometry
- virtual void SetShapeGeometry(const FW_CPoint& anchorPoint, const FW_CPoint& currentPoint);
- virtual ODShape* CreateShapeOutline(Environment *ev);
- virtual ODShape* CalcClipShape(Environment* ev);
- virtual FW_CRect GetRectGeometry() const;
-
- FW_CPoint GetLineStart() const
- {return fStart;}
- FW_CPoint GetLineEnd() const
- {return fEnd;}
-
- // ----- Selection
- virtual FW_Boolean HitTest(Environment *ev, FW_CGraphicContext& gc, const FW_CMouseEvent& theMouseEvent) const;
-
- // ----- Dragging
- virtual void OffsetShape(Environment *ev, FW_Fixed xDelta, FW_Fixed yDelta);
-
- // ----- Resize
- virtual void ResizeFeedback(FW_CGraphicContext& gc, const FW_CInk& ink, const FW_CStyle& style,
- short whichHandle, const FW_CPoint& mouseLoc);
- virtual void GetMapRects(short whichHandle, const FW_CPoint& lastLocation,
- FW_CRect& srcRect, FW_CRect& dstRect);
- virtual void GetHandleCenter(short whichHandle, FW_CPoint& center) const;
- virtual void MapShape(Environment *ev, const FW_CRect& srcRect, const FW_CRect& dstRect);
-
- // ----- Drawing
- virtual void RenderShape(Environment* ev, ODFacet* facet, FW_CGraphicContext& gc);
-
- // ----- Persistence
- virtual void Flatten(FW_CWritableStream& archive);
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
-
- // ----- Scripting -----
- virtual ODDescType GetObjectClass() const;
-
- private:
- void OutlineShape(FW_CGraphicContext& gc, const FW_CInk& ink, const FW_CStyle& style,
- const FW_CPoint& pt1, const FW_CPoint& pt2);
-
- private:
- FW_CPoint fStart;
- FW_CPoint fEnd;
- };
-
- #endif
-